from pydantic import BaseModel, ConfigDict
from typing import Optional, List
from uuid import UUID


class TopicCreate(BaseModel):
    topic_id: str
    topic_name: str
    topic_description: Optional[str] = None
    keywords: Optional[List[str]] = None
    extract_date: Optional[str] = None


class TopicRead(BaseModel):
    id: UUID
    topic_id: str
    topic_name: str
    topic_description: Optional[str] = None
    keywords_json: Optional[str] = None
    extract_date: str
    relevance_score: Optional[float] = None
    news_count: int
    processing_status: str

    model_config = ConfigDict(from_attributes=True)


class TopicUpdate(BaseModel):
    topic_name: Optional[str] = None
    topic_description: Optional[str] = None
    keywords: Optional[List[str]] = None
    relevance_score: Optional[float] = None
    processing_status: Optional[str] = None
